<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex align-stretch benben-position-layout flex IncomeDetail_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex align-center justify-between flex-sub IncomeDetail_fd0_0'>
          <view class='flex align-center IncomeDetail_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
            <text class='fu-iconfont2  IncomeDetail_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex align-center'>
            <text class='IncomeDetail_fd0_0_c1_c0'>收益明细</text>
          </view>
          <view class='flex align-center justify-end IncomeDetail_fd0_0_c0'>
            <image class='IncomeDetail_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"309.png"'
              @tap.stop="popupShow1691659233892=true"></image>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---收益明细-收益flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view>
          <benben-flex-tabs class-name='IncomeDetail_benbenTabsfd1_0' v-model="tabs" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='true' :top='88'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0" @change="queryListFunc()">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex flex align-center justify-around">
                  <view :class="{ 'checkTitlefd1_0': tabs == 'all', 'flex flex-wrap align-center': true }"
                    @tap="tabs = 'all'" :id="`benben_tabsfd1_0-title-item-${'all'}`">

                    <text>全部</text>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabs == 'unsettle', 'flex flex-wrap align-center': true }"
                    @tap="tabs = 'unsettle'" :id="`benben_tabsfd1_0-title-item-${'unsettle'}`">

                    <text>待结算</text>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabs == 'settled', 'flex flex-wrap align-center': true }"
                    @tap="tabs = 'settled'" :id="`benben_tabsfd1_0-title-item-${'settled'}`">

                    <text>已结算</text>

                  </view>
                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line IncomeDetail_linefd1_0">
                </view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>
        <view class='flex flex-wrap align-center IncomeDetail_fd1_1'>
          <view class='flex flex-wrap align-center IncomeDetail_fd1_1_c0'>
            <view class='flex flex-wrap align-center IncomeDetail_fd1_1_c0_c0'>
              <text class='IncomeDetail_fd1_1_c0_c0_c0' v-if="start_time!=''">{{start_time}}</text><text
                class='IncomeDetail_fd1_1_c0_c0_c0' v-if="start_time==''">开始时间</text>
            </view>
            <image class='IncomeDetail_fd1_1_c0_c1' mode="aspectFit" :src='STATIC_URL+"324.png"'
              @tap.stop="popupShow1691659233892=true"></image>
          </view>
          <text class='IncomeDetail_fd1_1_c1'>{{$t('至')}}</text>
          <view class='flex flex-wrap align-center IncomeDetail_fd1_1_c0'>
            <view class='flex flex-wrap align-center IncomeDetail_fd1_1_c2_c0'>
              <text class='IncomeDetail_fd1_1_c0_c0_c0' v-if="end_time!=''">{{end_time}}</text><text
                class='IncomeDetail_fd1_1_c0_c0_c0' v-if="end_time==''">结束时间</text>
            </view>
            <image class='IncomeDetail_fd1_1_c0_c1' mode="aspectFit" :src='STATIC_URL+"324.png"'
              @tap.stop="popupShow1691659233892=true"></image>
          </view>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch IncomeDetail_fd1_2'>
          <template v-for='(child,key1) in dataList'>
            <view class='flex flex-direction flex-wrap align-stretch IncomeDetail_fd1_2_c0' :key='key1'>
              <text class='IncomeDetail_fd1_2_c0_c0'>{{child.create_time}}</text>
              <view class='flex flex-wrap align-center IncomeDetail_fd1_2_c0_c1'>
                <text class='IncomeDetail_fd1_2_c0_c1_c0'>{{$t('收益金额：')}}</text>
                <text class='IncomeDetail_fd1_2_c0_c1_c0'>{{$t('￥')}}</text>
                <text class='flex-sub IncomeDetail_fd1_2_c0_c1_c0'>{{child.detail_bonus}}</text>
                <text class='IncomeDetail_fd1_2_c0_c1_c3' v-if="child.is_settle=='0'">{{$t('待结算')}}</text><text
                  class='IncomeDetail_fd1_2_c0_c1_c3' v-if="child.is_settle=='1'">已结算</text>
              </view>
              <view class='flex flex-wrap align-center'>
                <text class='IncomeDetail_fd1_2_c0_c2_c0'>{{$t('订单编号：')}}</text>
                <text class='IncomeDetail_fd1_2_c0_c2_c0'>{{child.order_sn}}</text>
              </view>
              <view class='flex flex-wrap align-center IncomeDetail_fd1_2_c0_c3'>
                <text class='IncomeDetail_fd1_2_c0_c2_c0'>{{$t('订单金额：')}}</text>
                <text class='IncomeDetail_fd1_2_c0_c2_c0'>{{$t('￥')}}</text>
                <text class='IncomeDetail_fd1_2_c0_c2_c0'>{{child.order_total}}</text>
              </view>
              <view class='flex flex-wrap align-center IncomeDetail_fd1_2_c0_c4'>
                <view>
                  <text class='IncomeDetail_fd1_2_c0_c4_c0_c0'>购买</text>
                  <text class='IncomeDetail_fd1_2_c0_c4_c0_c0'>{{child.goods_name}}</text>
                  <text class='IncomeDetail_fd1_2_c0_c4_c0_c0' v-if=" child.is_settle==0">，预计获得返佣</text><text
                    class='IncomeDetail_fd1_2_c0_c4_c0_c2_1' v-if=" child.is_settle!=0">，获得返佣</text>
                  <text class='IncomeDetail_fd1_2_c0_c4_c0_c0'>{{child.detail_bonus}}</text>
                  <text class='IncomeDetail_fd1_2_c0_c4_c0_c0'>元</text>
                </view>
              </view>
            </view>
          </template>
          <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
            :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
        </view>
      </view>

      <!---收益明细-收益flex布局结束-->
      <benben-popup v-model="popupShow1691659233892" :mask="true" :mask-close-able="true" mode='center'>
        <!---flex布局flex布局开始-->
        <view class="flex benben-flex-layout flex-wrap align-center">
          <benben-calendar-diy mode='range' year-arrow-color='#666666' month-arrow-color='#666666' start-text='开始'
            end-text='结束' active-bg-color='rgba(41,121,255,1)' range-bg-color='rgba(41,121,255,0.13)'
            :change-title='true' :change-year='true' :change-month='true' class='IncomeDetail_fd2_0'
            @change="queryListFunc()" :start-time.sync="start_time" :end-time.sync="end_time"></benben-calendar-diy>
        </view>

        <!---flex布局flex布局结束-->

      </benben-popup>


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "popupShow1691659233892": false,
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "tabs": "all",
        "start_time": "",
        "end_time": "",
        "dataList": [],
        "time": ""
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        time
      } = options
      if (time !== undefined) this.time = time
      this.dateTransFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {
      this.dateTransFunc()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //获取本月时间
      dateTransFunc() {
        if (this.time != '') {
          let date = new Date()
          let year = date.getFullYear();
          let month = date.getMonth() + 1;
          let day = date.getDate();

          month = (month > 9) ? month : ("0" + month);
          day = (day < 10) ? ("0" + day) : day;
          this.end_time = year + "-" + month + "-" + day;
          if (this.time == 'day') {
            this.start_time = this.end_time
          } else {
            this.start_time = year + "-" + month + "-01";
          }
        }
        this.queryListFunc()
      },
      //分销列表
      queryListFunc() {
        this.minixPagingListsApi = global.apiUrls.post62fb89d7689da;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          start_time: this.start_time,
          end_time: this.end_time,
          is_settle: this.tabs
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

        this.popupShow1691659233892 = false;
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .IncomeDetail_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .IncomeDetail_fd0_0_c2_c0 {
    width: 36rpx;
    height: 36rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .IncomeDetail_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333;
  }

  .IncomeDetail_fd0_0_c0_c0 {
    font-size: 32rpx;
    font-weight: 500;
    color: #333;
  }

  .IncomeDetail_fd0_0_c0 {
    width: 180rpx;
  }

  .IncomeDetail_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .IncomeDetail_fd1_2_c0_c4_c0_c2_1 {
    color: var(--benbenFontColor5);
    font-size: 24rpx;
    font-weight: 400;
    line-height: 30rpx;
    margin: 24rpx 0rpx 32rpx 0rpx;
  }

  .IncomeDetail_fd1_2_c0_c4_c0_c0 {
    color: var(--benbenFontColor5);
    font-size: 24rpx;
    font-weight: 400;
    line-height: 30rpx;
  }

  .IncomeDetail_fd1_2_c0_c4 {
    margin: 32rpx 0rpx 32rpx 0rpx;
  }

  .IncomeDetail_fd1_2_c0_c3 {
    border-bottom: 1px solid rgba(238, 238, 238, 1);
    margin: 16rpx 0rpx 0rpx 0rpx;
    padding: 0rpx 0rpx 24rpx 0rpx;
  }

  .IncomeDetail_fd1_2_c0_c2_c0 {
    color: #666666;
    font-size: 22rpx;
    font-weight: 400;
    line-height: 30rpx;
  }

  .IncomeDetail_fd1_2_c0_c1_c3 {
    color: var(--benbenFontColor4);
    font-size: 28rpx;
    font-weight: 400;
    line-height: 30rpx;
  }

  .IncomeDetail_fd1_2_c0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 30rpx;
  }

  .IncomeDetail_fd1_2_c0_c1 {
    margin: 16rpx 0rpx 16rpx 0rpx;
  }

  .IncomeDetail_fd1_2_c0_c0 {
    color: var(--benbenFontColor7);
    font-size: 24rpx;
    font-weight: 700;
    line-height: 33rpx;
  }

  .IncomeDetail_fd1_2_c0 {
    background: #FFFFFF;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    padding: 32rpx 24rpx 0rpx 24rpx;
    margin: 0rpx 0rpx 20rpx 0rpx;
  }

  .IncomeDetail_fd1_2 {
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .IncomeDetail_fd1_1_c2_c0 {
    color: #333333;
    font-size: 24rpx;
    line-height: 40rpx;
    font-weight: 400;
    margin: 0rpx 31rpx 0rpx 0rpx;
  }

  .IncomeDetail_fd1_1_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 40rpx;
    margin: 0rpx 24rpx 0rpx 24rpx;
  }

  .IncomeDetail_fd1_1_c0_c1 {
    width: 30rpx;
    height: 30rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .IncomeDetail_fd1_1_c0_c0_c0 {
    color: #333333;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 40rpx;
  }

  .IncomeDetail_fd1_1_c0_c0 {
    color: #333333;
    margin: 0rpx 31rpx 0rpx 0rpx;
  }

  .IncomeDetail_fd1_1_c0 {
    border: 1px solid #BFBFBF;
    background: #FFFFFF;
    border-radius: 8rpx 8rpx 8rpx 8rpx;
    padding: 11rpx 20rpx 11rpx 20rpx;
  }

  .IncomeDetail_fd1_1 {
    padding: 32rpx 0rpx 24rpx 24rpx;
  }

  .IncomeDetail_linefd1_0 {
    background: var(--benbenbgColor7);
    width: 40rpx;
    height: 8rpx;
    top: 80rpx;
    background-size: 100% auto !important;
    border-radius: 16rpx;
  }

  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 28rpx !important;
    color: rgba(0, 142, 77, 1) !important;
    background-color: rgba(255, 255, 255, 1) !important;
  }

  ::v-deep .IncomeDetail_benbenTabsfd1_0 {
    background: #fff;
    width: 750rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
    font-size: 32rpx;
    font-weight: 400;
    color: #666666;
  }

  .IncomeDetail_fd2_0 {
    background: #ffffff;
    width: 622rpx;
    border-radius: 24rpx;
    padding: 12rpx 012rpx 012rpx 012rpx;
  }
</style>